package com.ccys.doctor.controller;

import com.ccys.common.vo.ResponseResultApp;
import com.ccys.db.vo.doctor.consultationHistory.GetConsultationHistoryVo;
import com.ccys.doctor.service.ConsultationHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: WhiteCoat
 * @description: 咨询历史接口
 * @author: ZhangJingCan
 * @create: 2024-02-06 15:57
 **/

@RestController
@Api(tags = "咨询历史接口")
@RequestMapping("consultationHistory")
public class ConsultationHistoryController {

    @Autowired
    private ConsultationHistoryService consultationHistoryService;

    /**
     * 触发时机：医生门户->历史记录页面，加载页面和单击搜索时
     *
     * @param page_index 页数
     * @param page_size  条数
     * @param start_date 开始时间，格式： 2023/01/01
     * @param end_date   结束时间，格式： 2023/01/01
     * @param keyword    模糊搜索条件
     * @return
     */
    @ApiOperation("获取咨询历史")
    @GetMapping(value = "/GetConsultationHistory")
    public ResponseResultApp<GetConsultationHistoryVo> getConsultationHistory( Integer page_index,
                                                                               Integer page_size,
                                                                               String start_date,
                                                                               String end_date,
                                                                               String keyword) {
        return consultationHistoryService.getConsultationHistory(page_index, page_size, start_date, end_date, keyword);
    }

    @ApiOperation("搜索咨询记录")
    @GetMapping(value = "/GetIdConsultationHistory")
    public ResponseResultApp<List<String>> getIdConsultationHistory( String start_date,
                                                                     String end_date,
                                                                     String keyword) {
        return consultationHistoryService.getIdConsultationHistory(start_date, end_date, keyword);
    }

}
